<?php
if ( function_exists('register_sidebar') )
    register_sidebar(array(
        'before_widget' => '<div id="%1$s" class="widget %2$s">',
        'after_widget' => '</div>',
        'before_title' => '<h2 class="widgettitle">',
        'after_title' => '</h2>',
    ));

function gravatar() {
	global $comment;
	if (!get_option('show_avatars'))
		return;
	$rating = get_option('avatar_rating');
	$size = 48;
	$default = get_bloginfo('template_directory').'/images/comment-gravatar.jpg';
	$border = 'D2D4FA';
	$out = "http://www.gravatar.com/avatar.php?gravatar_id=".md5(strtolower($comment->comment_author_email));
	$out .= "&amp;rating=".$rating;
	$out .="&amp;size=".$size;
	$out .= "&amp;default=".urlencode($default);
	$out .= "&amp;border=".$border;
	echo '<img src="'.$out.'" class="gravatar" alt="Gravatar" />';
}

function gravatar_post() {
	if (!get_option('show_avatars'))
		return;
	$rating = get_option('avatar_rating');
	$size = 80;
	$default = get_bloginfo('template_directory').'/images/author-gravatar.jpg';
	$border = 'D2D4FA';
	$out = "http://www.gravatar.com/avatar.php?gravatar_id=".md5(strtolower(get_the_author_email()));
	$out .= "&amp;rating=".$rating;
	$out .="&amp;size=".$size;
	$out .= "&amp;default=".urlencode($default);
	$out .= "&amp;border=".$border;
	echo '<img src="'.$out.'" class="gravatar" alt="Gravatar" />';
}

function commentword() {
	$commentwords = array('said','wrote','replied','thought','commented');
	echo $commentwords[rand(0,4)];
}

?>
